<?php if(count($tabs) > 1): ?>

<nav class="tabbable">
    <ul class="nav nav-tabs">
        <?php
        foreach(array_keys($tabs) as $tab)
            echo '<li class="'.(($tab === $tab_active) ? 'active' : '').'"><a href="#'.$tab.'" data-toggle="tab">'.lang('events_tab_'.$tab).'</a></li>';
        ?>
    </ul>
    <div class="tab-content">
        <?php
        foreach($tabs as $tab => $data) {
            echo '<div class="tab-pane '.(($tab === $tab_active) ? 'active' : '').'" id="'.$tab.'">';
            $this->load->view($controller.'/'.$tab, $data);
            echo '</div>';
        }
        ?>
    </div>
</nav>

<?php else: ?>

<div id="page">
    <?php
    $tab = key($tabs);
    $this->load->view($controller.'/'.$tab, $tabs[$tab]);
    ?>
</div>

<?php endif; ?>